package com.pig4cloud.pigx.contract.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import com.pig4cloud.pigx.contract.annotation.SetScaleMainCurrency;
import com.pig4cloud.pigx.contract.annotation.SetScaleTokenCurrency;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 */
@Data
public class ContractOrderDetailedVO {

	/**
	 * (合约)币对名称
	 */
	private String symbolName;

	/**
	 * 订单号
	 */
	private Long id;

	/**
	 * 类型
	 */
	private String type;

	/**
	 * 状态
	 */
	private String status;

	/**
	 * 实际触发方向（0止盈、1止损）
	 */
	private String actualTriggerSide;

	/**
	 * 委托数量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleTokenCurrency
	private BigDecimal num;

	/**
	 * 委托数量（U本位）
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal currencyNum;

	/**
	 * 委托价格
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal price;

	/**
	 * 成交金额
	 */
	@SetScaleMainCurrency
	@ApiModelProperty(value = "成交金额")
	private BigDecimal dealAmount;

	/**
	 * 已成交数量
	 */
	@SetScaleTokenCurrency
	@ApiModelProperty(value = "已成交数量")
	private BigDecimal dealNum;

	/**
	 * 已成交数量（U）
	 */
	@SetScaleMainCurrency
	@ApiModelProperty(value = "已成交数量（U）")
	private BigDecimal currencyDealNum;

	/**
	 * 成交均价
	 */
	@SetScaleMainCurrency
	@ApiModelProperty(value = "成交均价")
	private BigDecimal dealAvg;

	/**
	 * 止盈触法价格
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal stopProfitTrigger;

	/**
	 * 止盈委托价格
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal stopProfitPrice;

	/**
	 * 止损触法价格
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal stopLostTrigger;

	/**
	 * 止损委托价格
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal stopLostPrice;

	/**
	 * 手续费
	 */
	@SetScaleMainCurrency
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal handlingFee;

	/**
	 * 收益（已实现盈亏）
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal profit;

	/**
	 * 委托时间
	 */
	private LocalDateTime createTime;

	/**
	 * 收益率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency(scale = 2)
	private BigDecimal profitRate;

	/**
	 * 主币名称
	 */
	@ApiModelProperty(value = "主币名称")
	private String mainCurName;

	/**
	 * 外币名称
	 */
	@ApiModelProperty(value = "外币名称")
	private String tokenCurName;

	/**
	 * 成交明细
	 */
	private List<ContractTradeDetailedVO> tradeList;

	/**
	 * 方向（0做多、1做空）
	 */
	@ApiModelProperty(value = "方向（0做多、1做空）")
	private String side;

	/**
	 * 平多/平空
	 */
	@ApiModelProperty(value = "平多/平空")
	private String sideType;

	/**
	 * 张数
	 */
	@ApiModelProperty(value = "张数")
	private BigDecimal sheet;
}
